<?php namespace Core\Myapp\Helper\Admin\Form\Group\Element;

class Select
{
    protected $_data = array();
    public function __construct($data)
    {
        $this->_data = $data;
    }
    public function render()
    {
        ob_start();
        echo '<div class="form-element">';
        if($this->_data['label'])
            echo '<label for="'.$this->_data['name'].'" class="label">'.$this->_data['label'].'</label>';
        echo '<select name="'.$this->_data['name'].'">';
        foreach($this->_data['options'] as $key=>$val) {
            echo '<option value="'.$key.'">'.$val.'</option>';
        }
        echo '</select>';
        echo '</div>';
        $html = ob_get_clean();
        return $html;
    }
}